<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>国际单位换算工具</title>
    <link rel="stylesheet" href="style.css">
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
</head>
<body>
    <div class="container">
        <header>
            <h1><i class="fas fa-exchange-alt"></i> 国际单位换算工具</h1>
            <p>支持长度、重量、温度、体积等单位换算</p>
        </header>

        <main>
            <div class="converter-card">
                <div class="unit-selector">
                    <button class="unit-btn active" data-type="length">长度</button>
                    <button class="unit-btn" data-type="weight">重量</button>
                    <button class="unit-btn" data-type="temperature">温度</button>
                    <button class="unit-btn" data-type="volume">体积</button>
                </div>

                <div class="converter-form">
                    <div class="input-group">
                        <label>输入数值</label>
                        <input type="number" id="inputValue" placeholder="请输入数值" step="any">
                        <select id="inputUnit"></select>
                    </div>

                    <div class="convert-arrow">
                        <i class="fas fa-arrow-down"></i>
                    </div>

                    <div class="input-group">
                        <label>转换结果</label>
                        <input type="text" id="outputValue" readonly>
                        <select id="outputUnit"></select>
                    </div>
                </div>

                <button class="swap-btn" onclick="swapUnits()">
                    <i class="fas fa-exchange-alt"></i> 交换单位
                </button>
            </div>

            <div class="quick-reference">
                <button class="toggle-btn" onclick="toggleReference()">
                    <i class="fas fa-table"></i> 常用换算表
                    <i class="fas fa-chevron-down" id="toggleIcon"></i>
                </button>
                <div class="reference-content" id="referenceContent">
                    <div class="reference-grid" id="referenceGrid"></div>
                </div>
            </div>
        </main>

        <footer>
            <p>© 2024 国际单位换算工具 | 支持移动端使用</p>
        </footer>
    </div>

    <script src="script.js"></script>
</body>
</html>
